package com.gin.kotlin.no_gay_alliance.database.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.gin.kotlin.no_gay_alliance.database.entity.ReplyHistoryUser

@Dao
interface ReplyHistoryUserDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun add(user: ReplyHistoryUser)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun add(users: List<ReplyHistoryUser>)

    @Update
    fun update(users: List<ReplyHistoryUser>)

    @Delete
    fun del(user: ReplyHistoryUser)

    @Query("delete from ReplyHistoryUser where userId=:userId")
    fun del(userId: Long)

    @Query("select * from ReplyHistoryUser")
    fun list(): List<ReplyHistoryUser>?

    @Query("select * from ReplyHistoryUser where userId=:userId")
    fun get(userId:Long):ReplyHistoryUser?
}